package com.fkcai.hansoul.ai.controller;

import com.fkcai.hansoul.ai.model.dto.AiChatDto;
import com.fkcai.hansoul.ai.model.vo.AiChatVo;
import com.fkcai.hansoul.ai.service.HanYunAIService;
import com.fkcai.hansoul.common.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 汉韵 AI 控制器
 */
@Slf4j
@RestController
@RequestMapping("/api/ai")
public class HanYunAIController {
	@Autowired
	private HanYunAIService hanYunAIService;
	
	/**
	 * 聊天接口
	 * @param aiChatDto 聊天请求 dto
	 * @return 聊天结果
	 */
	@PostMapping("/chat")
	public Result<AiChatVo> chat(@RequestBody AiChatDto aiChatDto) {
		AiChatVo Data = hanYunAIService.chat(aiChatDto);
		
		return Result.success(Data);
	}
}
